<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML
><HEAD
><TITLE
>Type Conversion</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
REV="MADE"
HREF="mailto:pgsql-docs@postgresql.org"><LINK
REL="HOME"
TITLE="PostgreSQL 9.1.2 Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="The SQL Language"
HREF="sql.html"><LINK
REL="PREVIOUS"
TITLE="Trigger Functions"
HREF="functions-trigger.html"><LINK
REL="NEXT"
TITLE="Overview"
HREF="typeconv-overview.html"><LINK
REL="STYLESHEET"
TYPE="text/css"
HREF="stylesheet.css"><META
HTTP-EQUIV="Content-Type"
CONTENT="text/html; charset=ISO-8859-1"><META
NAME="creation"
CONTENT="2011-12-01T22:07:59"></HEAD
><BODY
CLASS="CHAPTER"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="5"
ALIGN="center"
VALIGN="bottom"
><A
HREF="index.html"
>PostgreSQL 9.1.2 Documentation</A
></TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="top"
><A
TITLE="Trigger Functions"
HREF="functions-trigger.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="top"
><A
HREF="sql.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="60%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="20%"
ALIGN="right"
VALIGN="top"
><A
TITLE="Overview"
HREF="typeconv-overview.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="CHAPTER"
><H1
><A
NAME="TYPECONV"
></A
>Chapter 10. Type Conversion</H1
><DIV
CLASS="TOC"
><DL
><DT
><B
>Table of Contents</B
></DT
><DT
>10.1. <A
HREF="typeconv-overview.html"
>Overview</A
></DT
><DT
>10.2. <A
HREF="typeconv-oper.html"
>Operators</A
></DT
><DT
>10.3. <A
HREF="typeconv-func.html"
>Functions</A
></DT
><DT
>10.4. <A
HREF="typeconv-query.html"
>Value Storage</A
></DT
><DT
>10.5. <A
HREF="typeconv-union-case.html"
><TT
CLASS="LITERAL"
>UNION</TT
>, <TT
CLASS="LITERAL"
>CASE</TT
>, and Related Constructs</A
></DT
></DL
></DIV
><P
><ACRONYM
CLASS="ACRONYM"
>SQL</ACRONYM
> statements can, intentionally or not, require
the mixing of different data types in the same expression.
<SPAN
CLASS="PRODUCTNAME"
>PostgreSQL</SPAN
> has extensive facilities for
evaluating mixed-type expressions.</P
><P
>In many cases a user does not need
to understand the details of the type conversion mechanism.
However, implicit conversions done by <SPAN
CLASS="PRODUCTNAME"
>PostgreSQL</SPAN
>
can affect the results of a query.  When necessary, these results
can be tailored by using <SPAN
CLASS="emphasis"
><I
CLASS="EMPHASIS"
>explicit</I
></SPAN
> type conversion.</P
><P
>This chapter introduces the <SPAN
CLASS="PRODUCTNAME"
>PostgreSQL</SPAN
>
type conversion mechanisms and conventions.
Refer to the relevant sections in <A
HREF="datatype.html"
>Chapter 8</A
> and <A
HREF="functions.html"
>Chapter 9</A
>
for more information on specific data types and allowed functions and
operators.</P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="functions-trigger.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="typeconv-overview.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Trigger Functions</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="sql.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Overview</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>